package com.zkw.gro.cloure.demo

/**
 * Created by Administrator on 2016/4/9 0009.
 */
class MoreClosureMain {
    /**
     * 参数的数量
     * @param closure
     * @return
     */
    def static caller(Closure closure){
        closure.getParameterTypes().size()
    }
    def static curryTest(){
        def adder = {x,y -> return x+y}
        def addOne = adder.curry(1)
        assert addOne(5) == 6
    }


    public static void main(String[] args) {
        assert caller {one ->} == 1
        assert caller {one,two ->} ==2

    }
}
